import request from '@/router/axios';


export const mailList = (templateName,pageNo, pageSize, createNames) => { // 查询邮件模板列表
  return request({
    url: '/api/blade-marketing/emailTemplate/page',
    method: 'get',
    params: {
      templateName,
      pageNo,
      pageSize,
      createNames
    }
  })
}

export const saveMailTemplate = (custInfoDto) => { // 查询邮件模板列表
  return request({
    url: '/api/blade-marketing/emailTemplate',
    method: 'post',
    data: custInfoDto
  })
}

export const deleteMailTemplate = (id) => { // 删除邮件模板
  return request({
    url: `/api/blade-marketing/emailTemplate/${id}`,
    method: 'delete'
  })
}

export const mailTemplateDetail = (id) => { // 查询单个详情
  return request({
    url: `/api/blade-marketing/emailTemplate/${id}`,
    method: 'get'
  })
}

export const editMailTemplate = (id, form) => { // 修改单个模板
  return request.put(`/api/blade-marketing/emailTemplate/${id}`, form)
}

export const changeShare = (id, en) => { //启用开关
  return request.put(`/api/blade-marketing/emailTemplate/${id}/share/${en}`)
}
export const getNextMan = () => { // 获取下属列表
  return request({
    url: '/api/blade-marketing/emailTemplate/createNames',
    method: 'get'
  })
}
export const copyRule = (id,name) => { //复制/api/blade-marketing/marketingSocialRule/${id}/copy?name=xxxx
  return request.put(`/api/blade-marketing/emailTemplate/${id}/copy?name=${name}`)
}
